<?php

namespace Sisesporte\Repository;

use Doctrine\ORM\EntityRepository;

class RendaFamiliarRepository extends EntityRepository {

    public function fetchPairs() {
        $entities = $this->findAll();

        $array = array();

        foreach ($entities as $entity) {
            if ($entity->getSqRendaFamiliar() == '1') {
                $array[$entity->getSqRendaFamiliar()] = "Menor que " . $entity->getVlRendaFamiliarAte();
            } else {
                if ($entity->getSqRendaFamiliar() == '7') {
                    $array[$entity->getSqRendaFamiliar()] = "Maior que " . $entity->getVlRendaFamiliarDe();
                } else {
                    $array[$entity->getSqRendaFamiliar()] = "De " . $entity->getVlRendaFamiliarDe() . " Até " . $entity->getVlRendaFamiliarAte();
                }
            }
        }

        return $array;
    }

}
